<div>
    <g:if test="${session?.customer && session?.customer?.getId() != listingInstance?.seller?.getId()}">


        <g:set var="newBidEntity" value="${message(code: 'bid.label', default: 'Bid')}" />
        <g:formRemote name="myBidForm" update="[success:'updateMe',failure:'updateMe']"
                url="[controller:'bid', action:'placeBid']">

            <h1  align="left"><g:message code="default.place.descriptive.label" args="[newBidEntity]" /></h1>
            <div class="formField" align="left">
                <g:textField align="left" name="amount" value="" />
                <div id="updateBidAmount">
                    <g:render template="/listing/nextBidPrice" model="[nextBidPrice:listingInstance.nextBidPrice">Place Bid</g:render>
                </div>
            </div>
            %{-- <div class="formField" align="left">
                <label for="buyerEmailAddress" style="text-align: right;padding-right: 5px;">Buyer Email Address:</label>
                <g:textField align="left" name="buyerEmailAddress" />
            </div>--}%
            <g:hiddenField name="buyerEmailAddress" value="${session.customer.emailAddress}" />
            <g:hiddenField name="selectedListName" value="${listingInstance?.listName}" />

            <div class="button" align="left"><g:submitButton name="save" class="save" value="${message(code: 'default.new.label', default: 'New', args:[newBidEntity])}" /></div>
        </g:formRemote>
        <script type="text/javascript">
            function getValues() {
                <g:remoteFunction controller="listing"  action="showNextBidAmount" update="updateBidAmount" params='[listName:listingInstance.listName]'></g:remoteFunction>
            }
            new PeriodicalExecuter(getValues,1);
        </script>
    </g:if>
</div>
